import { createSlice } from '@reduxjs/toolkit'

type TSearchState = {
	search: string
}

const initialState: TSearchState = {
	search: '',
}

const sliceName = 'search'

export const searchSlice = createSlice({
	name: sliceName,
	initialState,
	reducers: {
		setSearch: (state, action) => {
			state.search = action.payload
		},
	},
})
